mixin type(t, relatedTypes)
  if !t
  else if t.type && t.type === 'FunctionType'
    | (
    each p, index in t.params
      +type(p, relatedTypes)
      if index < t.params.length - 1
        |, 
    | ) => 
    if t.result === null
      | undefined
    else
      +type(t.result, relatedTypes)
  else if t.type && t.type === 'TypeApplication'
    +type(t.expression, relatedTypes)
    | &lt;
    each p, index in t.applications
      +type(p, relatedTypes)
      if index < t.applications.length - 1
        |,
    | &gt;
  else if t.type && t.type === 'StringLiteralType'
    | "!{t.value}"
  else if t.type && t.type === 'OptionalType'
    | [
    +type(t.expression, relatedTypes)
    | ]
  else if t.type && t.type === 'RecordType'
    |{
    for field, idxField in t.fields
      +type(field, relatedTypes)
      if idxField < t.fields.length - 1
        |, 
    |}
  else if t.type && t.type === 'FieldType'
    | !{t.key}: 
    +type(t.value, relatedTypes)
  else if t.type && t.type === 'UnionType'
    each p, index in t.elements
      +type(p, relatedTypes)
      if index < t.elements.length - 1
        ||
  else if t.name
    if t.name !== 'Object' && t.name !== 'Array' && t.name[0] === t.name[0].toUpperCase()
      - const symbol = relatedTypes && relatedTypes.find(t2 => t2 && t.name === t2.name) || {};
      - const isExternal = symbol.kind === 'external'
      if symbol.name && isExternal
        - const firstSee = symbol.tags.find(t => t.title === 'see') || {};
        a.typed-link(href=firstSee.description, target='_blank')=t.name
      else if symbol.name
        a.typed-link(href=`${navPath}#struct-${t.name}`)=t.name
    else
      | !{t.name}
